import Vue from 'vue'
import Router from 'vue-router'
import Goods from '@/components/goods/goods'
import Sellers from '@/components/sellers/sellers'
import Ratings from '@/components/ratings/ratings'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/Goods'
    },
    {
      path: '/goods',
      name: 'Goods',
      component: Goods
    },
    {
      path: '/sellers',
      name: 'Sellers',
      component: Sellers
    },
    {
      path: '/ratings',
      name: 'Ratings',
      component: Ratings
    }
  ],
  scrollBehavior (to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return { x: 0, y: 0 }
    }
  }
})
